package com.gtlab1207.br_awareness.models.domain;


import com.fasterxml.jackson.annotation.JsonFormat;
import org.springframework.format.annotation.DateTimeFormat;

import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Pattern;
import javax.validation.constraints.Size;
import java.util.Date;

/**
 * 扫描日志主机实体类
 */
public class LogHost extends BaseDomain {

    /**
     * 主机ip地址
     */
    @NotNull(message = "请输入主机ip地址")
    @Pattern(regexp = "^(25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[0-9]{1,2})(\\.(25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[0-9]{1,2})){3}$", message = "请输入正确的ip地址")
    private String ipAddress;

    /**
     * 主机登录用户名
     */
    @Size(max = 32, message = "用户名长度不能超过32个字符")
    @NotBlank(message = "请输入主机登录用户名")
    private String user;

    /**
     * 主机登录密码
     */
    @NotBlank(message = "请输入主机登录密码")
    private String password;

    /**
     * 系统日志文件地址
     */
    private String systemLogPath;

    /**
     * 安全模块日志文件地址
     */
    private String securityLogPath;

    /**
     * suricata日志文件地址
     */
    private String suricataLogPath;

    /**
     * 上次扫描时间
     */
    @JsonFormat(pattern="yyyy-MM-dd HH:mm:ss",timezone="GMT+8")
    @DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss")
    private Date lastScanTime;

    /**
     * 是否启用日志扫描，yes/no
     */
    private String isActivate = "yes";


    public String getUser() {
        return user;
    }

    public void setUser(String user) {
        this.user = user;
    }

    public String getPassword() {
        return password;
    }

    public void setPassword(String password) {
        this.password = password;
    }

    public String getIpAddress() {
        return ipAddress;
    }

    public void setIpAddress(String ipAddress) {
        this.ipAddress = ipAddress;
    }

    public String getSystemLogPath() {
        return systemLogPath;
    }

    public void setSystemLogPath(String systemLogPath) {
        this.systemLogPath = systemLogPath;
    }

    public String getSecurityLogPath() {
        return securityLogPath;
    }

    public void setSecurityLogPath(String securityLogPath) {
        this.securityLogPath = securityLogPath;
    }

    public String getSuricataLogPath() {
        return suricataLogPath;
    }

    public void setSuricataLogPath(String suricataLogPath) {
        this.suricataLogPath = suricataLogPath;
    }

    public Date getLastScanTime() {
        return lastScanTime;
    }

    public void setLastScanTime(Date lastScanTime) {
        this.lastScanTime = lastScanTime;
    }

    public String getIsActivate() {
        return isActivate;
    }

    public void setIsActivate(String isActivate) {
        this.isActivate = isActivate;
    }
}
